<template>
  <div class="main">
    <div class="header">
      <div class="epName">
        {{ info.company_name }}
        <span>{{ info.status }}</span>
        <span
          class="collect-span"
          v-if="info.collect == 1"
          @click="changeCollect"
        >
          <img src="@img/details/icon-collect-select.png" alt="" />
          已收藏
        </span>
        <span
          class="normal-span"
          v-if="info.collect == 2"
          @click="changeCollect"
        >
          <img src="@img/details/icon-collect-normal.png" alt="" />
          收 藏
        </span>
        <span class="goBack" @click="$router.go(-1)">返回</span>
      </div>
      <div class="zizhi">
        <span v-if="info.isfive">{{ info.isfive }}</span>
        <span v-if="info.quoted_company">{{ info.quoted_company }}</span>
        <span v-if="info.high_new">{{ info.high_new }}</span>
        <!-- <span v-if="info.zjtg">{{ info.zjtg }}</span> -->
        <span v-if="info.unicorn">{{ info.unicorn }}</span>
        <span v-if="info.dengl">{{ info.dengl }}</span>
        <span v-if="info.tbe">{{ info.tbe }}</span>
        <!-- <span v-if="info.scale">{{ info.scale }}</span> -->
        <!-- <span v-if="info.tbe_sjmy">{{ info.tbe_sjmy }}</span> -->
        <!-- <span v-if="info.zjtg_gjjxjr">{{ info.zjtg_gjjxjr }}</span> -->
        <!-- <span v-if="info.zjtg_sjxjr">{{ info.zjtg_sjxjr }}</span> -->
      </div>
      <ul class="epClassify">
        <li>
          <p>所在地区：</p>
          <p>
            {{ info.district }}
          </p>
        </li>
        <li>
          <p>联系电话：</p>
          <p>{{ info.telephone }}</p>
        </li>
        <li>
          <p>邮箱：</p>
          <p>{{ info.email }}</p>
        </li>
        <li>
          <p>官网：</p>
          <p class="max-200">
            <!-- <a v-if="info.web_site.includes('http')" :href="info.web_site" target="_blank">{{ info.web_site }}</a> -->
            <span @click="$copy(info.web_site)">{{ info.web_site }}</span>
          </p>
        </li>
      </ul>
    </div>
    <div class="main_body">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="工商信息" name="businessInformation">
          <div class="header_title">基本注册信息</div>
          <div class="table_one">
            <table border="1" padding="0" v-if="Object.keys(info).length > 0">
              <tr>
                <td>法定代表人</td>
                <td>{{ info.legal }}</td>
                <td>统一社会信用代码</td>
                <td>{{ info.social_code }}</td>
                <td>注册资本</td>
                <td>{{ info.capital }}</td>
              </tr>
              <tr>
                <td>成立日期</td>
                <td>{{ info.build_date }}</td>
                <td>企业（机构）类型</td>
                <td>{{ info.entype }}</td>

                <td>纳税人识别号</td>
                <td>{{ info.tax_code }}</td>
              </tr>
              <tr>
                <td>参保人数</td>
                <td>{{ info.bao }}</td>

                <td>工商注册号</td>
                <td>{{ info.register_code }}</td>
                <td>所属行业</td>
                <td>{{ info.industry }}</td>
              </tr>
              <tr>
                <td>登记机关</td>
                <td>
                  {{ info.register_org }}
                </td>
                <td>经营范围</td>
                <td colspan="4" class="detail">
                  {{ info.scope }}
                </td>
                <!-- <td>经营范围</td>
                <td colspan="5" class="detail">{{ info.scope }}</td> -->
              </tr>
              <tr>
                <td>企业介绍</td>
                <td colspan="5" class="detail" v-html="info.company_info"></td>
              </tr>
              <tr>
                <td>注册地址</td>
                <td colspan="5">
                  {{ info.address }}
                  <p
                    class="show_map"
                    v-if="info.jwd.lat != '-'"
                    @click="showMap = true"
                  >
                    查看地图 >
                  </p>
                </td>
              </tr>
            </table>
          </div>
          <div class="height_box"></div>
          <el-dialog title="注册地址" :visible.sync="showMap">
            <div class="map_box">
              <baidu-map
                v-if="showMap == true"
                class="bm-view"
                :center="info.jwd"
                :zoom="18"
                ak="tZT2SxRwIIig1eO8z0IgZaYfArwRdunb"
                :scroll-wheel-zoom="true"
              >
                <bm-marker
                  :position="info.jwd"
                  :icon="{ url: iconPng, size: { width: 36, height: 41 } }"
                >
                  <bm-label
                    :content="info.company_name"
                    :labelStyle="{
                      color: '#ff3a56',
                      fontSize: '14px',
                      border: 'none',
                      background: 'rgba(255,255,255,.9)',
                      padding: '4px',
                    }"
                    :offset="{ width: 40, height: 10 }"
                  />
                </bm-marker>
              </baidu-map>
            </div>

            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="showMap = false">
                关闭
              </el-button>
            </div>
          </el-dialog>
        </el-tab-pane>
        <el-tab-pane label="经营状况" name="operatingConditions">
          <div class="header_title">行政许可</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>决定文书/许可编号</td>
                <td>决定文书/许可证名称</td>
                <td>有效期自</td>
                <td>有效期至</td>
                <td>许可机关</td>
                <td>许可内容</td>
                <td>来源</td>
              </tr>
              <tr
                style="height: 48px;"
                v-if="loading1 == true"
                v-loading="loading1"
              ></tr>
              <tr
                class="row_item"
                v-for="(item, index) in select2_info_label1"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.licence_no }}</td>
                <td>{{ item.licence_name }}</td>
                <td>{{ item.from_date }}</td>
                <td>{{ item.end_date }}</td>
                <td>{{ item.license_org }}</td>
                <td>{{ item.licence_content }}</td>
                <td>{{ item.source }}</td>
              </tr>
              <tr v-if="select2_info_label1.length == 0 && loading1 == false">
                <td colspan="8" style="text-align: center;">暂无数据</td>
              </tr>
            </table>
          </div>
          <div class="header_title">行政处罚</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>决定文书编号</td>
                <td>处置日期</td>
                <td>处置单位</td>
                <td>违法详情</td>
                <td>处置结果</td>
                <td>来源</td>
              </tr>
              <tr
                style="height: 48px;"
                v-if="loading7 == true"
                v-loading="loading7"
              ></tr>
              <tr
                class="row_item"
                v-for="(item, index) in select2_info_label7"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.punish_no }}</td>
                <td>{{ item.pub_date }}</td>
                <td>{{ item.punish_org }}</td>
                <td>{{ item.punish_reason }}</td>
                <td>{{ item.punish_content }}</td>
                <td>{{ item.sources }}</td>
              </tr>
              <tr
                v-if="
                  !select2_info_label7 ||
                    (select2_info_label7.length == 0 && loading7 == false)
                "
              >
                <td colspan="7" style="text-align: center;">暂无数据</td>
              </tr>
            </table>
          </div>
          <div class="header_title">资质证书</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>发证时间</td>
                <td>证书类别</td>
                <td>证书号</td>
                <td>截止时间</td>
              </tr>
              <tr
                style="height: 48px;"
                v-if="loading8 == true"
                v-loading="loading8"
              ></tr>
              <tr
                class="row_item"
                v-for="(item, index) in select2_info_label8"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.start_date }}</td>
                <td>{{ item.type }}</td>
                <td>{{ item.cert_no }}</td>
                <td>{{ item.end_date }}</td>
              </tr>
              <tr v-if="select2_info_label8.length == 0 && loading8 == false">
                <td colspan="5" style="text-align: center;">暂无数据</td>
              </tr>
            </table>
          </div>
          <div class="header_title">税务信用</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>评价年度</td>
                <td>纳税人识别号</td>
                <td>纳税信用等级</td>
                <td>单位评价</td>
              </tr>
              <tr
                style="height: 48px;"
                v-if="loading2 == true"
                v-loading="loading2"
              ></tr>
              <tr
                class="row_item"
                v-for="(item, index) in select2_info_label2"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.year }}</td>
                <td>{{ item.id_number }}</td>
                <td>{{ item.grade }}</td>
                <td>{{ item.eval_department }}</td>
              </tr>
              <tr v-if="select2_info_label2.length == 0 && loading2 == false">
                <td colspan="5" style="text-align: center;">暂无数据</td>
              </tr>
            </table>
          </div>
          <div class="header_title">进出口信用</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>注册海关</td>
                <td>经营类别</td>
                <td>注册日期</td>
                <td>行业类别</td>
              </tr>
              <tr
                style="height: 48px;"
                v-if="loading3"
                v-loading="loading3"
              ></tr>
              <tr
                class="row_item"
                v-for="(item, index) in select2_info_label3"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.customs_registered_address }}</td>
                <td>{{ item.management_category }}</td>
                <td>{{ item.record_date }}</td>
                <td>{{ item.industry_category }}</td>
              </tr>
              <tr v-if="select2_info_label3.length == 0 && loading3 == false">
                <td colspan="5" style="text-align: center;">暂无数据</td>
              </tr>
            </table>
          </div>
          <div class="header_title">供应商</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>商家名称</td>
                <td>采购占比</td>
                <td>采购金额（万元）</td>
                <td>报告期/公开时间</td>
                <td>数据来源</td>
                <td>关联关系</td>
              </tr>
              <tr
                style="height: 48px;"
                v-if="loading4 == true"
                v-loading="loading4"
              ></tr>
              <tr
                class="row_item"
                v-for="(item, index) in select2_info_label4"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.supplier_name }}</td>
                <td>{{ item.ratio }}</td>
                <td>{{ item.amount }}</td>
                <td>{{ item.pub_date }}</td>
                <td>{{ item.sources }}</td>
                <td>{{ item.relation }}</td>
              </tr>
              <tr v-if="select2_info_label4.length == 0 && loading4 == false">
                <td colspan="7" style="text-align: center;">暂无数据</td>
              </tr>
            </table>
          </div>
          <div class="header_title">客户</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>客户名称</td>
                <td>销售占比</td>
                <td>销售金额（万元）</td>
                <td>报告期/公开时间</td>
                <td>数据来源</td>
                <td>关联关系</td>
              </tr>
              <tr
                style="height: 48px;"
                v-if="loading5 == true"
                v-loading="loading5"
              ></tr>
              <tr
                class="row_item"
                v-for="(item, index) in select2_info_label5"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.client_name }}</td>
                <td>{{ item.ratio }}</td>
                <td>{{ item.amount }}</td>
                <td>{{ item.pub_date }}</td>
                <td>{{ item.sources }}</td>
                <td>{{ item.relation }}</td>
              </tr>
              <tr v-if="select2_info_label5.length == 0 && loading5 == false">
                <td colspan="7" style="text-align: center;">暂无数据</td>
              </tr>
            </table>
          </div>
          <div class="height_box"></div>
        </el-tab-pane>
        <el-tab-pane label="企业风险" name="enterpriseRisk">
          <div class="header_title">股权出质</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>登记编号</td>
                <td>出质人</td>
                <td>出质股权标的企业</td>
                <td>质权人</td>
                <td>出质股权数额</td>
                <td>登记日期</td>
                <td>状态</td>
              </tr>
              <tr
                class="row_item"
                v-for="(item, index) in select3_info"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.reg_number }}</td>
                <td>{{ item.pledgor }}</td>
                <td>{{ item.target_company }}</td>
                <td>{{ item.pledgee }}</td>
                <td>{{ item.amount }}</td>
                <td>{{ item.pub_date }}</td>
                <td>{{ item.status }}</td>
              </tr>
              <tr v-if="select3_info.length == 0 || !select3_info">
                <td colspan="7" style="text-align: center;">暂无数据</td>
              </tr>
            </table>
          </div>
          <div class="height_box"></div>
        </el-tab-pane>
        <el-tab-pane label="知识产权" name="intellectualProperty">
          <div class="header_title">专利信息</div>
          <div class="table">
            <table border="1" padding="0">
              <tr class="row_header">
                <td>序号</td>
                <td>发明名称</td>
                <td>发明类型</td>
                <td>状态</td>
                <td>申请号</td>
                <td>申请日</td>
                <td>公开（公告）号</td>
                <td>发明人</td>
              </tr>
              <tr
                class="row_item"
                v-for="(item, index) in select4_info"
                :key="index"
              >
                <td>{{ index + 1 }}</td>
                <td>{{ item.name }}</td>
                <td>{{ item.type }}</td>
                <td>{{ item.status }}</td>
                <td>{{ item.num }}</td>
                <td>{{ item.day }}</td>
                <td>{{ item.open_num }}</td>
                <td>{{ item.person }}</td>
              </tr>
            </table>
          </div>
          <div class="height_box"></div>
        </el-tab-pane>
        <el-tab-pane label="供应链图谱" name="atlas">
          <div class="atlas">
            <div class="chart-box" ref="chartGraph"></div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="供应链地图" name="map">
          <div class="map">
            <div class="chart-box" ref="chartMap"></div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
import {
  tyEpDetails,
  nationwideEpDetails,
  detailsZero,
  detailsNext,
  getSemicMap,
  epCollect,
  GetEnterpriseEquity,
  GetEnterprisePunish,
  GetEnterpriseInoutInfo,
  GetEnterpriseLicence,
  GetEnterpriseTaxInfo,
  GetEnterpriseSupplier,
  GetEnterpriseClient,
  GetEnterpriseCertificate,
  GetEnterprisePatent,
} from "@api/details";
import china from "@map/china.json";
import iconPng from "@img/public/icon-location.png";
import BaiduMap from "vue-baidu-map/components/map/Map.vue";
export default {
  data() {
    return {
      activeName: "businessInformation",
      // 是否初始化图表
      init: false,
      initGraph: false,
      chartMap: null,
      chartGraph: null,

      // 展示地图
      iconPng: iconPng,
      showMap: false,
      // 全国企业  or  太原企业
      type: "",
      // 企业id
      id: null,
      // 企业详情
      info: {},
      // 地图数据
      mapData: [],
      graphNodes: [],
      graphLinks: [],
      select3_info: [],
      select4_info: {},
      select2_info_label1: [],
      loading1: true,
      select2_info_label2: [],
      loading2: true,
      select2_info_label3: [],
      loading3: true,
      select2_info_label4: [],
      loading4: true,
      select2_info_label5: [],
      loading5: true,
      select2_info_label6: [],
      loading6: true,
      select2_info_label7: [],
      loading7: true,
      select2_info_label8: [],
      loading8: true,
      select2_info_label9: [],
    };
  },
  components: {
    BaiduMap,
  },
  mounted() {
    this.id = this.$route.params.id;
    this.type = this.$route.params.type;
    this.$bus.$emit("setActive", this.$route.params.activeMenu);
    this.getDetail(this.id, this.type);
  },

  methods: {
    async changeCollect() {
      let res = await epCollect({
        id: this.info.id,
        collect: this.info.collect,
        choice: this.info.choice,
      });
      if (res.code == 0) {
        this.info.collect = res.collect;
        // this.info = this.info;
      }
    },

    // 企业风险
    async getEnterpriseEquity() {
      const res = await GetEnterpriseEquity(
        this.id,
        this.type == "qg" ? "enterprise" : ""
      );
      if (!res.code) {
        this.select3_info = res;
      } else {
        this.select3_info = [];
      }
    },
    // 经营状况-行政处罚
    async getEnterprisePunish() {
      this.loading7 = true;
      GetEnterprisePunish(this.id, this.type == "qg" ? "enterprise" : "").then(
        (res) => {
          if (!res.code) {
            this.select2_info_label7 = res;
          } else {
            this.select2_info_label7 = [];
          }
          this.loading7 = false;
        }
      );
    },
    // 经营状况-进出口信用
    async getEnterpriseInoutInfo() {
      this.loading3 = true;
      GetEnterpriseInoutInfo(
        this.id,
        this.type == "qg" ? "enterprise" : ""
      ).then((res) => {
        if (!res.code) {
          this.select2_info_label3 = res;
        } else {
          this.select2_info_label3 = [];
        }
        this.loading3 = false;
      });
    },

    // 行政许可
    async GetEnterpriseLicence() {
      this.loading1 = true;
      GetEnterpriseLicence(this.id, this.type == "qg" ? "enterprise" : "").then(
        (res) => {
          if (!res.code) {
            this.select2_info_label1 = res;
          } else {
            this.select2_info_label1 = [];
          }
          this.loading1 = false;
        }
      );
    },
    // 税务信用
    async GetEnterpriseTaxInfo() {
      this.loading2 = true;
      GetEnterpriseTaxInfo(this.id, this.type == "qg" ? "enterprise" : "").then(
        (res) => {
          if (!res.code) {
            this.select2_info_label2 = res;
          } else {
            this.select2_info_label2 = [];
          }
          this.loading2 = false;
        }
      );
    },
    // 供应商
    async GetEnterpriseSupplier() {
      this.loading4 = true;
      GetEnterpriseSupplier(
        this.id,
        this.type == "qg" ? "enterprise" : ""
      ).then((res) => {
        if (!res.code) {
          this.select2_info_label4 = res;
        } else {
          this.select2_info_label4 = [];
        }
        this.loading4 = false;
      });
    },
    //  客户
    async GetEnterpriseClient() {
      this.loading5 = true;
      GetEnterpriseClient(this.id, this.type == "qg" ? "enterprise" : "").then(
        (res) => {
          if (!res.code) {
            this.select2_info_label5 = res;
          } else {
            this.select2_info_label5 = [];
          }
          this.loading5 = false;
        }
      );
    },
    //  资质证书
    async GetEnterpriseCertificate() {
      this.loading8 = true;
      GetEnterpriseCertificate(
        this.id,
        this.type == "qg" ? "enterprise" : ""
      ).then((res) => {
        if (!res.code) {
          this.select2_info_label8 = res;
        } else {
          this.select2_info_label8 = [];
        }
        this.loading8 = false;
      });
    },
    //  专利信息
    async GetEnterprisePatent() {
      GetEnterprisePatent(this.id, this.type == "qg" ? "enterprise" : "").then(
        (res) => {
          if (!res.code) {
            this.select4_info = res;
          } else {
            this.select4_info = [];
          }
        }
      );
    },
    async getDetail(id) {
      let res = "";
      if (this.type == "ty") {
        res = await tyEpDetails({ id });
      } else if (this.type == "qg") {
        res = await nationwideEpDetails({ id });
      }
      if (res.code && res.code != 0) {
      } else {
        this.info = res;
        this.getFindZero(this.info.company_name);
        this.getMap(this.info.company_name);
      }
    },
    async getMap(company_name) {
      let res = await getSemicMap({
        company_name,
      });
      if (res.code && res.code != 0) {
      } else {
        this.mapData = res.map((item) => {
          return {
            name: item.name,
            value: [item.jwd.lng, item.jwd.lat],
          };
        });
        if (this.chartMap != null) {
          this.upDataChart();
        }
      }
    },
    async getFindZero(company_name) {
      let res = await detailsZero({
        company_name,
      });
      if (res.code && res.code != 0) {
        this.graphNodes = [];
        this.graphLinks = [];
      } else {
        let links = [];
        res.links.map((item) => {
          links.push({
            source: item.from,
            target: item.to,
            value: item.text,
            symbolSize: 20,
          });
        });
        let nodes = [];
        res.nodes.map((item) => {
          nodes.push({
            id: item.id,
            name: item.name,
            nickname: item.nickname,
            isOpen: false,
            category: item.category,
            draggable: true,
          });
        });
        this.graphNodes = nodes;
        this.graphLinks = links;
      }

      if (this.chartGraph != null) {
        this.upDataChartGraph();
      }
    },

    async getFindNext(category, name) {
      let res = await detailsNext({
        category,
        name,
      });
      if (res.code && res.code != 0) {
      } else {
        let links = [];
        res.links.map((item) => {
          links.push({
            source: item.from,
            target: item.to,
            value: item.text,
            symbolSize: 20,
          });
        });
        let nodes = [];
        res.nodes.map((item) => {
          nodes.push({
            category: item.category,
            id: item.id,
            name: item.name,
            nickname: item.nickname,
            isOpen: false,
            draggable: true,
            value: item.text,
          });
        });
        let list = [...this.graphNodes];
        nodes.map((item) => {
          let a = list.filter((el) => {
            return item.id == el.id;
          });
          if (a.length == 0) {
            list.push(item);
          }
        });
        this.graphNodes = [...list];
        this.graphLinks = [...this.graphLinks, ...links];
        if (this.chartGraph != null) {
          this.upDataChartGraph();
        }
      }
    },

    handleClick(e) {
      if (e.label == "供应链地图" && this.init == false) {
        this.init = true;
        this.$nextTick(() => {
          this.initChartsMap();
        });
      }
      if (e.label == "供应链图谱" && this.initGraph == false) {
        this.initGraph = true;
        this.$nextTick(() => {
          this.initChartsGraph();
        });
      }
      if (e.label == "企业风险") {
        this.getEnterpriseEquity();
      }
      if (e.label == "经营状况") {
        this.getEnterprisePunish();
        this.getEnterpriseInoutInfo();
        this.GetEnterpriseLicence();
        this.GetEnterpriseTaxInfo();
        this.GetEnterpriseSupplier();
        this.GetEnterpriseClient();
        this.GetEnterpriseCertificate();
      }
      if (e.label == "知识产权") {
        this.GetEnterprisePatent();
      }
    },
    initChartsMap() {
      this.chartMap = this.$echarts.init(this.$refs.chartMap);
      this.$echarts.registerMap("china", china);
      const initOption = {
        backgroundColor: "#013954",
        tooltip: {
          trigger: "item",
          position: "bottom",
          formatter: function(params) {
            if (params.componentSubType == "effectScatter") {
              return params.marker + " " + params.data.name;
            } else if (params.componentSubType == "scatter") {
              return params.marker + " " + params.data.name;
            } else if (params.componentSubType == "lines") {
              return (
                params.marker +
                " " +
                params.data.name +
                " --> " +
                params.data.toName
              );
            }
          },
        },
        geo: {
          map: "china",
          zoom: 1.2,

          color: [""],
          roam: true, //是否允许缩放
          select: {
            itemStyle: {
              areaColor: {
                type: "radial",
                x: 0.5,
                y: 0.5,
                r: 0.8,
                colorStops: [
                  {
                    offset: 0,
                    color: "rgba(147, 235, 248, 0)", // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: "rgba(147, 235, 248, .2)", // 100% 处的颜色
                  },
                ],
                globalCoord: false, // 缺省为 false
              },
            },
            label: {
              show: true,
              color: "#fff",
            },
          },
          emphasis: {
            itemStyle: {
              areaColor: {
                type: "radial",
                x: 0.5,
                y: 0.5,
                r: 0.8,
                colorStops: [
                  {
                    offset: 0,
                    color: "rgba(147, 235, 248, 0)", // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: "rgba(147, 235, 248, .2)", // 100% 处的颜色
                  },
                ],
                globalCoord: false, // 缺省为 false
              },
            },
            label: {
              show: true,
              color: "#fff",
            },
          },
          label: {
            color: "#fff",
          },
          itemStyle: {
            borderColor: "rgba(147, 235, 248, 1)",
            borderWidth: 1,
            areaColor: {
              type: "radial",
              x: 0.5,
              y: 0.5,
              r: 0.8,
              colorStops: [
                {
                  offset: 0,
                  color: "rgba(147, 235, 248, 0)", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "rgba(147, 235, 248, .2)", // 100% 处的颜色
                },
              ],
              globalCoord: false, // 缺省为 false
            },
            shadowColor: "rgba(128, 217, 248, 1)",
            // shadowColor: 'rgba(255, 255, 255, 1)',
            shadowOffsetX: -2,
            shadowOffsetY: 2,
            shadowBlur: 10,
          },
        },
        series: [
          {
            type: "lines",
            coordinateSystem: "geo",
            zlevel: 1,
            effect: {
              show: true,
              period: 8,
              trailLength: 0.04,
              symbol: "arrow",
              symbolSize: 10,
            },
            lineStyle: {
              width: 1,
              opacity: 1,
              curveness: 0.3,
              color: "#ffe15c",
            },
          },
          {
            type: "effectScatter",
            coordinateSystem: "geo",
            zlevel: 2,
            rippleEffect: {
              period: 4,
              brushType: "stroke",
              scale: 3,
            },
            label: {
              show: false,
              position: "right",
              formatter: "{b}",
              offset: [5, 0],
              fontSize: 16,
              color: "#ffe15c",
            },
            symbolSize: 14,
            symbol: "circle",
            itemStyle: {
              show: false,
              color: "#ffe15c",
            },
          },
          {
            type: "scatter",
            coordinateSystem: "geo",
            zlevel: 3,
            rippleEffect: {
              period: 4,
              brushType: "stroke",
              scale: 4,
            },
            opacity: 1,
            label: {
              show: true,
              position: "left",
              color: "#1de9b7",
              fontSize: 20,
              fontWeight: 600,
              formatter: "{b}",
            },
            itemStyle: {
              show: true,
              position: "right",
              color: "#1de9b7",
            },
            emphasis: {
              label: { show: true, color: "#1de9b7", fontWeight: 600 },
            },
            symbol: "pin",
            symbolSize: 30,
          },
        ],
      };
      this.chartMap.setOption(initOption);
      if (this.mapData.length > 0) {
        this.upDataChart();
      }
    },
    upDataChart() {
      let data = this.mapData.map((item) => {
        return [
          {
            coord: item.value,
            name: item.name,
          },
          {
            coord: [this.info.jwd.lng, this.info.jwd.lat],
            name: this.info.company_name,
          },
        ];
      });

      let options = {
        series: [
          {
            data: data,
          },
          {
            data: this.mapData,
          },
          {
            data: [
              {
                name: this.info.company_name,
                value: [this.info.jwd.lng, this.info.jwd.lat],
              },
            ],
          },
        ],
      };
      this.chartMap.setOption(options);
    },
    initChartsGraph() {
      this.chartGraph = this.$echarts.init(this.$refs.chartGraph);
      const option = {
        tooltip: {},
        animationDurationUpdate: 1000,
        animationEasingUpdate: "quinticInOut",
        series: [
          {
            type: "graph", // 类型:关系图
            layout: "force", //图的布局，类型为力导图
            symbolSize: 50, // 调整节点的大小
            roam: true, //支持拖拽缩放
            edgeSymbol: ["circle", "arrow"],
            edgeSymbolSize: 10,
            zoom: 0.8,
            edgeLabel: {
              show: true,
              textStyle: {
                fontSize: 12,
              },
              formatter: function(params) {
                return params.data.value;
              },
            },
            force: {
              repulsion: 1600,
              edgeLength: 160,
            },
            draggable: false,
            itemStyle: {
              color: "#5b9bd5",
            },
            emphasis: {
              itemStyle: {
                color: "#2164a1",
              },
            },
            // symbolSize: 80,
            // symbolOffset: [20,0],
            lineStyle: {
              opacity: 0.9,
              width: 4,
              curveness: 0,
              color: "#b5cbe7",
            },
            label: {
              show: true,
              textStyle: {},
            },
            data: [],
            // [
            //   {
            //     id: 4,
            //     name: "新一代信息技术",
            //     category: 1,
            //     draggable: true, // 是否可以拖拽，默认false
            //     value: 60, //图形大小
            //   },
            //   {
            //     id: 35,
            //     name: "大数据及人工智能(136)",
            //     category: 2,
            //     color: "#43a2f1",
            //     value: 60, //图形大小
            //   },
            // ]
            links: [],
            // [
            //   {
            //     source: 0,
            //     target: 1,
            //     symbolSize: 20,
            //   },
            //   {
            //     source: 0,
            //     target: 2,
            //     symbolSize: 20,
            //   },
            // ]
          },
        ],
      };
      this.chartGraph.setOption(option);
      this.chartGraph.on("click", (item) => {
        console.log(item.data);
        if (item.data.category == 4) {
          return;
        }
        if (item.data.isOpen == false) {
          this.graphNodes.map((i) => {
            if (i.id == item.data.id) {
              i.isOpen = true;
            }
          });
          this.getFindNext(
            item.data.category,
            item.data.nickname || item.data.name
          );
        } else {
        }
      });
      this.upDataChartGraph();
    },
    upDataChartGraph() {
      let options = {
        series: [
          {
            data: this.graphNodes,
            links: this.graphLinks,
          },
        ],
      };
      this.chartGraph.setOption(options);
    },
  },
};
</script>

<style lang="less" scoped>
.zizhi {
  margin: 10px 0 0px 0px;
  height: 30px;
  line-height: 30px;
  span {
    float: left;
    margin-right: 10px;
    padding: 0px 16px;
    height: 30px;
    background: rgba(88, 169, 220, 0.8);
    border-radius: 4px;
    color: #fff;
  }
}
.main {
  width: 100%;
  height: 100%;
  background: #fff;
  text-align: left;
  .header {
    box-sizing: border-box;
    width: 100%;
    height: 260px;
    background: url("~@img/public/bg-company.png") no-repeat center;
    padding: 0 210px;
  }
  .main_body {
    width: 100%;
    height: calc(100% - 260px);
  }
}
.map_box {
  height: 500px;
}
/deep/ .el-dialog {
  width: 780px;
  height: 700px;
  margin-top: -350px !important;
}
.epName {
  padding-top: 40px;
  font-size: 40px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #ffffff;
  line-height: 52px;
  span {
    margin-left: 30px;
    display: inline-block;
    width: 70px;
    height: 30px;
    line-height: 30px;
    background: #f89718;
    opacity: 0.8;
    border-radius: 4px;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
  }
  span.collect-span {
    width: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #ffffff;
    img {
      position: relative;
      top: 4px;
    }
  }
  span.normal-span {
    width: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #ffffff;
    img {
      position: relative;
      top: 4px;
    }
  }
  .goBack {
    margin-top: 7px;
    float: right;
    width: 100px;
    height: 38px;
    line-height: 38px;
    background: #5889dc;
    font-weight: 400;
    opacity: 1;
  }
}
.show_map {
  cursor: pointer;
  color: #5889dc;
}
.epClassify {
  display: flex;
  justify-content: flex-start;

  li {
    padding: 0 80px;
    margin-top: 10px;
    position: relative;
    cursor: pointer;
    &::before {
      position: absolute;
      top: 50%;
      left: 0;
      margin-top: -20px;
      display: block;
      content: "";
      width: 1px;
      height: 40px;
      background: #ffffff;
      opacity: 0.5;
    }
    &:first-of-type {
      padding-left: 0;
      &::before {
        opacity: 0;
      }
    }
    p {
      font-size: 20px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #ffffff;
      line-height: 56px;
      opacity: 0.6;
      white-space: nowrap;
      &:last-child {
        font-size: 20px;
        opacity: 0.9;
      }
    }
  }
}
.header_title {
  margin-top: 30px;
  margin-bottom: 20px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #333333;
}
table {
  width: 100%;
  border-color: #ddd;
  tr {
    td {
      padding: 0 20px;
      height: 46px;
      line-height: 46px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #333333;
    }
  }
  tr.row_header {
    td {
      background: #f7faff;
    }
  }
  tr.row_item {
    td {
      background: #fff;
    }
  }
}
.table_one table {
  border-color: #ddd;
  tr {
    td {
      padding: 0 20px;
      height: 46px;
      line-height: 46px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #333333;
    }
    td:nth-of-type(odd) {
      width: 190px;
      background: #f7faff;
    }
    td:nth-of-type(even) {
      width: 280px;
    }
    .detail {
      padding: 15px 20px;
      line-height: 22px;
    }
  }
}

.atlas {
  margin: 20px 0 0 0;
  width: 100%;
  height: 100%;
  background: url("~@img/public/bg-gyltp.png") no-repeat center;
}
.map {
  margin-top: 30px;
  height: 90%;
  background: #e6e7e7;
  box-shadow: 0px 0px 9px 0px rgba(189, 189, 189, 0.67);
  border-radius: 10px;
}
.chart-box {
  width: 100%;
  height: 100%;
}
.bm-view {
  width: 100%;
  height: 100%;
}
// 选项卡样式修改
/deep/ .el-tabs__nav-scroll {
  padding-left: 210px;
}
/deep/.el-tabs__item {
  padding: 0 60px 0 0;
  font-size: 20px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #333333;
  height: 60px;
  line-height: 60px;
}
/deep/.el-tabs__item.is-active {
  font-weight: bold;
  color: #0043b3;
}
/deep/.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  padding-left: 0px;
}
/deep/.el-tabs__active-bar {
  height: 4px;
  background: #0043b3;
}
/deep/ .el-tabs__nav-wrap {
  box-shadow: 0px 2px 6px 0px rgba(4, 0, 0, 0.1);
}
/deep/ .el-tabs__nav-wrap::after {
  height: 0;
}
/deep/.el-tabs__header {
  margin: 0;
}
/deep/ .el-tab-pane {
  width: 100%;
  height: 100%;
}
/deep/.el-tabs {
  height: 100%;
  .el-tabs__content {
    box-sizing: border-box;
    height: calc(100% - 60px);
    padding: 0px 240px 30px;
    overflow-y: auto;
    scrollbar-color: #767ffe #e9f3ff; //滚动条轨道颜色   滚动条滑块的颜色
    scrollbar-width: 6px;
    scrollbar-width: thin; //thin模式下滚动条两端的三角按钮会消失
    &::-webkit-scrollbar {
      /*滚动条整体样式*/
      width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
      height: 10px;
    }
    &::-webkit-scrollbar-thumb {
      /*滚动条里面小方块*/
      border-radius: 10px;
      background: linear-gradient(0deg, #767ffe, #79aefe);
    }
    &::-webkit-scrollbar-track {
      /*滚动条里面轨道*/
      background: #e9f3ff;
      border-radius: 10px;
    }
  }
}
/deep/ .rel-node-checked {
  box-shadow: 0px 0px 10px #2f48c8;
  animation: none;
}
/deep/ .rel-node-shape-0:hover {
  box-shadow: 0px 0px 10px #2f48c8;
}
/deep/ .rel-node-peel:hover .rel-node {
  box-shadow: 0px 0px 10px #2f48c8;
}

.main .header {
  padding: 0 210px;
}
.height_box {
  height: 30px;
}
@media screen and (min-width: 1366px) and (max-width: 1600px) {
  .main .header {
    padding: 0 20px;
  }
  /deep/ .el-tabs .el-tabs__content {
    padding: 0px 200px 30px;
  }
}
@media only screen and (width: 1366px) {
  .main .header {
    padding: 0 20px;
  }
  /deep/ .el-tabs .el-tabs__content {
    padding: 0px 200px 30px;
  }
}
@media screen and (max-width: 1200px) {
  .main .header {
    padding: 0 20px;
  }
  .epClassify li p {
    font-size: 16px;
  }
  .epClassify li p:last-child {
    font-size: 18px;
  }
  .epClassify li {
    padding: 0 30px;
  }
  /deep/ .el-tabs__nav-scroll {
    padding-left: 30px;
  }
  /deep/ .el-tabs .el-tabs__content {
    padding: 0 30px 30px;
  }
}
.max-200 {
  max-width: 200px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  a {
    color: #ffffff;
  }
}
/deep/ .el-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 690px;
  margin-left: -450px;
  margin-top: -345px !important;
  background: #ffffff;
  box-shadow: 0px 5px 50px 0px rgba(186, 186, 186, 0.5);
  border-radius: 20px;
}
/deep/ .el-dialog__header {
  width: 604px;
  margin: 0 auto;
  padding: 0;
  height: 80px;
  line-height: 80px;
  text-align: center;
  border-bottom: 1px dashed #dddddd;
}
/deep/ .el-dialog__body {
  padding: 20px;
}

/deep/ .el-dialog__title {
  font-size: 30px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #446db3;
}
/deep/ .el-dialog__body {
  text-align: center;
}
/deep/ .el-dialog__headerbtn {
  top: 4px;
}
/deep/ .el-dialog__headerbtn:hover i {
  color: #446db3;
}
/deep/ .el-dialog__headerbtn i {
  font-size: 30px;
  color: #446db3;
  font-weight: bold;
}

/deep/ .el-dialog__body {
  span {
    display: inline-block;
    width: 120px;
    font-size: 18px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #333333;
  }
  span.tips {
    margin: 20px 0;
    width: 100%;
    font-size: 24px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #333333;
  }
  text-align: center;
}
/deep/ .el-dialog__footer {
  padding: 0;
  text-align: center;
}
/deep/.el-dialog .el-button--default {
  width: 247px;
  height: 48px;
  line-height: 0.8;
  border-radius: 10px;
  font-size: 26px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #446db3;
  border: 2px solid #446db3;
}
/deep/.el-dialog .el-button--primary {
  width: 247px;
  height: 48px;
  line-height: 0.8;
  // background: linear-gradient(90deg, #1a6dc1, #446DB3);

  background: #446db3;
  box-shadow: 0px 2px 5px 0px rgba(68, 109, 179, 0.5);
  border-radius: 10px;
  font-size: 26px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #fff;
}

.flex_dialog {
  display: flex;
  .flex-steps {
    flex: 0 0 150px;
    height: 650px;
  }
  .flex-from {
    flex: 1;
  }
}
/deep/ .el-dialog__body .pro_plus span {
  width: 200px;
}
/deep/.dialog_box .pro_plus .el-input {
  width: 400px;
}
.pro_plus .pos_f .pos {
  right: 120px;
}
/deep/.el-dialog__body .el-select__tags span span {
  width: 120px;
  span {
    width: 80px;
  }
}
</style>
